package com.jf.yytgd.validation.constrain;

import com.jf.yytgd.validation.validator.VisibleASCIIValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Created with IntelliJ IDEA
 * Description: 可视ASCII注解. 支持{String}数据类型. null为非法
 * User:22954
 * Date:2025-01-14
 * Time:10:42
 */
@Documented
@Constraint(validatedBy = {VisibleASCIIValidator.class})
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
public @interface VisibleASCII {
    String message() default "{com.jf.yytgd.validation.constrain.OnlyASCII.message}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
